#include <linux/backlight.h>
#include <drm/drmP.h>
#include <drm/drm.h>
#include "vir_v_dev.h"

#define BLC_PWM_PRECISION_FACTOR 100	/* 10000000 */
#define BLC_PWM_FREQ_CALC_CONSTANT 32
#define MHz 1000000

#define PSB_BLC_PWM_PRECISION_FACTOR    10
#define PSB_BLC_MAX_PWM_REG_FREQ        0xFFFE
#define PSB_BLC_MIN_PWM_REG_FREQ        0x2

#define PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR (0xFFFE)
#define PSB_BACKLIGHT_PWM_CTL_SHIFT	(16)

static int psb_brightness;
static struct backlight_device *psb_backlight_device;

static int psb_save_display_registers(struct drm_device *dev)
{
	return 0;
}

static int psb_output_init(struct drm_device *dev)
{
	return 0;
}

static int psb_backlight_setup(struct drm_device *dev)
{
	return 0;
}

static int psb_set_brightness(struct backlight_device *bd)
{
	return 0;
}

static int psb_backlight_init(struct drm_device *dev)
{
	return 0;
}

static void psb_init_pm(struct drm_device *dev)
{
	return 0;
}

static int psb_save_display_registers(struct drm_device *dev)
{
	return 0;
}

static int psb_restore_display_registers(struct drm_device *dev)
{
	return 0;
}

static int psb_power_down(struct drm_device *dev)
{
	return 0;
}

static int psb_power_up(struct drm_device *dev)
{
	return 0;
}

static void psb_get_core_freq(struct drm_device *dev)
{
	return 0;
}

static int psb_chip_setup(struct drm_device *dev)
{
	return 0;
}

static void psb_chip_teardown(struct drm_device *dev)
{

}

const struct psb_ops psb_chip_ops = {
	.name = "Poulsbo",
	.accel_2d = 1,
	.pipes = 2,
	.crtcs = 2,
	.hdmi_mask = (1 << 0),
	.lvds_mask = (1 << 1),
	.cursor_needs_phys = 1,
	.sgx_offset = PSB_SGX_OFFSET,
	.chip_setup = psb_chip_setup,
	.chip_teardown = psb_chip_teardown,

	.crtc_helper = &psb_intel_helper_funcs,
	.crtc_funcs = &psb_intel_crtc_funcs,

	.output_init = psb_output_init,

#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
	.backlight_init = psb_backlight_init,
#endif

	.init_pm = psb_init_pm,
	.save_regs = psb_save_display_registers,
	.restore_regs = psb_restore_display_registers,
	.power_down = psb_power_down,
	.power_up = psb_power_up,
};

